class UserMailer < ActionMailer::Base
  def signup_notification(user)
    setup_email(user)
    @subject    += '请激活您注册的新帐号'
  
    @body[:url]  = "http://www.yipingba.com/#{user.nick_name}/activate/#{user.signup_user_verify.verify_code}"
  
  end
  
  def activation(user)
    setup_email(user)
    @subject    += '你的帐号已经激活!'
    @body[:url]  = "http://www.yipingba.com/"
  end
  
  protected
    def setup_email(user)
      @recipients  = "#{user.email}"
      @from        = "ADMINEMAIL"
      @subject     = "Yipingba[衣评吧] "
      @sent_on     = Time.now
      @body[:user] = user
    end
end
